<template>
 <!-- 常用语 -->
    <div>
       

         
   <label >常用语库</label>
      <el-divider></el-divider>
       <el-row>  
           <el-col :span="8">
                    <el-input placeholder="搜索常用语" style="width:70%">
                    <el-button  slot="append"  id="search"  @click="a">搜索</el-button >
                    </el-input>
                </el-col>
                 <el-col :span="7" style="float:right">
                    <el-button type="primary" >添加分类</el-button>
                     <el-button>添加常用语</el-button>
                      <el-button>导入常用语</el-button>
                </el-col>
            </el-row>

    
            <el-collapse accordion v-model="activeNames">
                <el-collapse-item v-for="(item,index) in setupCwGroupData" :key="index" >
                    <template slot="title">
                        <div style = "width:100%">
                            <label >{{item.u_c_name}}{{item}}</label>
                            <span style="float:right">6666666666</span>
                        </div>
                    
                    </template>
                    <div  v-for="(data,no) in setupCwData" :key="no" >
                        <span v-if="item.useful_category_id = data.useful_category_id">{{item.useful_category_id}}{{data.u_content}}{{ data.useful_category_id}}</span>
                    </div>
                   
                </el-collapse-item>
               
            </el-collapse>
    </div>
</template>


<style scoped>

#search {
padding: 11px;
  background-color: #0170f3;
  border-radius: 0%;
  color: #ffffff;
 
} 
.el-button{
    padding: 12px 12px;
    border-radius: 0px;
   
}



</style>
<script>
import {mapState} from 'vuex'
export default {
    name:"CommonWords",
    data(){
        return{
        status:1,
        activeName:"first",
        setupgractive:1,
        setupggactive:1,
        activeNames:[]
        }
    },
     computed:{
        ...mapState("SetupModule",["setupCwGroupData","setupCwData"])
    },
    methods:{
        activev(activeNames){
            alert(activeNames)
        },
        a(){
             console.log(this.setupCwGroupData);
        }
    },
    mounted(){
        this.$store.dispatch('SetupModule/allcwgroup',{status:this.status})
        this.$store.dispatch('SetupModule/allcw',{status:this.status})
    }
}

</script>